﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'applicationGetId')
	BEGIN
		DROP  Procedure  applicationGetId
	END
GO

-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[applicationGetId]
	-- Add the parameters for the stored procedure here
	@app_name VARCHAR(50),
	@company_id INT
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	DECLARE @app_id INT
    -- Insert statements for procedure here
	SELECT @app_id = lit_aplicacion_id
	FROM lit_aplicacion
	WHERE lit_empresa_id = @company_id
	AND lit_aplicacion_nombre = @app_name;

	SELECT @app_id;
END
GO